home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / miscellaneous / patch / pagestream / postscript.prolog < prev    next >
Encoding:
Text File  |  1996-09-07  |  24.7 KB  |  967 lines

  1. %%BeginProlog
  2. % $VER: PostScript.prolog 1.0i (31.10.95)
  3. % fixed picstr problem in BeginRGBBitmap (7.10.94)
  4. % added font reencoding support (29.10.94)
  5. % complete change to fill/stroke for support for text (02.02.95)
  6. % fixed landscape to non-letter sizes
  7. % fixed grave/quotesingle encoding (15.02.95)
  8. % changed for new tm2d based code w/ new object calls (15.03.95)
  9. % fixed process color seps (24.03.95)
  10. % added PPDSetup/PPDCleanup (20.06.95)
  11. % now reencodes Courier for document name in slug (eeckk!) (09.07.95)
  12. % reencode dict increased by 2 (02.08.95)
  13. % recursive object tm (15.08.95)
  14. % prolog dict increased to 200 (01.09.95)
  15. % prolog rewrite of fill/stroke routines for text & added newpath to dograd/doradial/doshape (01.09.95)
  16. % new BeginClip/EndClip & BeginEPS/EndEPS (10.10.95)
  17. % new LNE/LNS line start & end routines (30.10.95)
  18. % moved LNE/LNS into ST (21.11.95)
  19. % fixed ST problem with y direction (18.01.96)
  20. % line ends no longer choke on zero length segments (28.3.96)
  21. %Copyright 1994-96 Soft-Logik Publishing Corp.
  22.  
  23. /AsphaltDict dup 200 dict def load begin
  24.  
  25. %
  26. % basic definitions
  27. %
  28. /bdef {bind def}bind def
  29. /xdef {exch def}bdef
  30. /ldef {load def}bdef
  31. /dmatrix matrix def
  32. /tmatrix matrix def
  33. /pmatrix matrix def
  34.  
  35. /deltax 0 def
  36. /deltay 0 def
  37. /slant 0 def
  38. /twist 0 def
  39. /xscl 0 def
  40. /yscl 0 def
  41. /bang 0 def
  42. /eang 0 def
  43.  
  44. /tilescalex 0 def
  45. /tilescaley 0 def
  46. /bh 0 def
  47. /bv 0 def
  48.  
  49. %
  50. % fill defines
  51. %
  52. /SG /setgray ldef
  53. systemdict /setcmykcolor known not
  54.  {/SCMYK {1 sub 4 1 roll 3 {3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdef}
  55.  {/SCMYK /setcmykcolor ldef}ifelse
  56.  
  57. %
  58. % drawing definitions
  59. %
  60. /sclm [0 0 0 0 0 0] def
  61. /scl{transform round .2 add exch round .2 add exch itransform}bdef
  62.  
  63. %
  64. %
  65. %
  66. /PGSEncoding 256 array def
  67. % duplicates: acute, quoteleft, quoteright
  68. % 000-007
  69. /.notdef        /dotlessi        /grave            /acute            /circumflex        /tilde            /breve            /dotaccent
  70. % 010-017
  71. /ring            /hungarumlaut    /ogonek            /caron            /.notdef        /.notdef        /.notdef        /.notdef
  72. % 020-027
  73. /quotedblbase    /quotesinglbase    /quotesingle    /quoteleft        /quoteright        /.notdef        /.notdef        /.notdef
  74. % 030-037
  75. /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef        /.notdef
  76. % 040-047
  77. /space            /exclam            /quotedbl        /numbersign        /dollar            /percent        /ampersand        /quotesingle
  78. % 050-057
  79. /parenleft        /parenright        /asterisk        /plus            /comma            /hyphen            /period            /slash
  80. % 060-067
  81. /zero            /one            /two            /three            /four            /five            /six            /seven
  82. % 070-077
  83. /eight            /nine            /colon            /semicolon        /less            /equal            /greater        /question
  84. % 100-107
  85. /at                /A                /B                /C                /D                /E                /F                /G
  86. % 110-117
  87. /H                /I                /J                /K                /L                /M                /N                /O
  88. % 120-127
  89. /P                /Q                /R                /S                /T                /U                /V                /W
  90. % 130-137
  91. /X                /Y                /Z                /bracketleft    /backslash        /bracketright    /asciicircum    /underscore
  92. % 140-147
  93. /grave            /a                /b                /c                /d                /e                /f                /g
  94. % 150-157
  95. /h                /i                /j                /k                /l                /m                /n                /o
  96. % 160-167
  97. /p                /q                /r                /s                /t                /u                /v                /w
  98. % 170-177
  99. /x                /y                /z                /braceleft        /bar            /braceright        /asciitilde        /.notdef
  100. % 200-207
  101. /perthousand    /florin            /notequal        /infinity        /lessequal        /greaterequal    /.notdef        /.notdef
  102. % 210-217
  103. /ellipsis        /endash            /emdash            /quotedblleft    /quotedblright    /guilsinglleft    /guilsinglright    /pi                
  104. % 220-227
  105. /fraction        /dagger            /daggerdbl        /trademark        /bullet            /fi                /fl                /Ydieresis        
  106. % 230-237
  107. /Lslash            /lslash            /OE                /oe                /Scaron            /scaron            /Zcaron            /zcaron            
  108. % 240-247
  109. /space            /exclamdown        /cent            /sterling        /currency        /yen            /brokenbar        /section
  110. % 250-257
  111. /dieresis        /copyright        /ordfeminine    /guillemotleft    /logicalnot        /minus            /registered        /macron
  112. % 260-267
  113. /degree            /plusminus        /twosuperior    /threesuperior    /acute            /mu                /paragraph        /periodcentered
  114. % 270-277
  115. /cedilla        /onesuperior    /ordmasculine    /guillemotright    /onequarter        /onehalf        /threequarters    /questiondown
  116. % 300-307
  117. /Agrave            /Aacute            /Acircumflex    /Atilde            /Adieresis        /Aring            /AE                /Ccedilla
  118. % 310-317
  119. /Egrave            /Eacute            /Ecircumflex    /Edieresis        /Igrave            /Iacute            /Icircumflex    /Idieresis
  120. % 320-327
  121. /Eth            /Ntilde            /Ograve            /Oacute            /Ocircumflex    /Otilde            /Odieresis        /multiply
  122. % 330-337
  123. /Oslash            /Ugrave            /Uacute            /Ucircumflex    /Udieresis        /Yacute            /Thorn            /germandbls
  124. % 340-347
  125. /agrave            /aacute            /acircumflex    /atilde            /adieresis        /aring            /ae                /ccedilla
  126. % 350-357
  127. /egrave            /eacute            /ecircumflex    /edieresis        /igrave            /iacute            /icircumflex    /idieresis
  128. % 360-367
  129. /eth            /ntilde            /ograve            /oacute            /ocircumflex    /otilde            /odieresis        /divide
  130. % 370-377
  131. /oslash            /ugrave            /uacute            /ucircumflex    /udieresis        /yacute            /thorn            /ydieresis
  132. PGSEncoding 0 256 getinterval astore pop
  133.  
  134. %
  135. % path constructors
  136. %
  137. % - N -
  138. /N/newpath ldef
  139.  
  140. % x y M -
  141. /M{scl moveto}bdef
  142.  
  143. % x y L -
  144. /L{scl lineto}bdef
  145.  
  146. % cx1 cy1 cx2 cy2 px2 py2 C -
  147. /C{scl 6 2 roll scl 6 2 roll scl 6 2 roll curveto}bdef
  148.  
  149. % cx cy rx ry ba ea slant twist A -
  150. /A{matrix currentmatrix 9 1 roll /twist xdef/slant xdef/eang xdef/bang xdef/yscl xdef/xscl xdef scl translate xscl yscl scale sclm 0 twist cos put
  151. sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat 0 0 1 bang eang arc setmatrix}bdef
  152.  
  153. % cx cy rx ry ba ea slant twist AN -
  154. /AN{matrix currentmatrix 9 1 roll /twist xdef/slant xdef/eang xdef/bang xdef/yscl xdef/xscl xdef scl translate xscl yscl scale sclm 0 twist cos put
  155. sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat 0 0 1 bang eang arcn setmatrix}bdef
  156.  
  157. % - CP -
  158. /CP/closepath ldef
  159.  
  160. %
  161. % pattern fill operators
  162. %
  163. % - patternpath -
  164. /patternpath{ %bdef
  165.   /mypatternfont findfont begin FontDict /ctm get setmatrix
  166.   currentdict setfont
  167.  
  168.   FontDict begin
  169.     FontMatrix concat
  170.     width 0 dtransform
  171.     round width div exch round width div exch
  172.     0 height dtransform
  173.     round height div exch
  174.     round height div exch
  175.     0 0 transform round exch round exch
  176.     ptm astore setmatrix
  177.     pathbbox
  178.     height div ceiling height mul 4 1 roll
  179.     width div ceiling width mul 4 1 roll
  180.     height div floor height mul 4 1 roll
  181.     width div floor width mul 4 1 roll
  182.     2 index sub height div ceiling cvi exch
  183.     3 index sub width div ceiling cvi exch
  184.     4 2 roll moveto
  185.     FontMatrix ptm invertmatrix pop
  186.     { %repeat
  187.       gsave
  188.       ptm concat
  189.       dup str length idiv {str show}repeat
  190.       dup str length mod str exch 0 exch getinterval show
  191.       grestore
  192.       0 height rmoveto
  193.     }repeat
  194.     pop
  195.   end end
  196. }bdef
  197.  
  198. % - patternfill -
  199. /patternfill{ %bdef
  200.   gsave
  201.   1 setgray
  202.   fill
  203.   grestore
  204.  
  205.   gsave
  206.   clip patternpath
  207.   grestore
  208.   newpath
  209. }bdef
  210.  
  211. % - patterneofill -
  212. /patterneofill{ %bdef
  213.   gsave
  214.   1 setgray
  215.   eofill
  216.   grestore
  217.  
  218.   gsave
  219.   eoclip patternpath
  220.   grestore
  221.   newpath
  222. }bdef
  223.  
  224. % - patternstroke -
  225. /patternstroke{ %bdef
  226.   strokepath
  227.   gsave
  228.   1 setgray
  229.   eofill
  230.   grestore
  231.  
  232.   gsave
  233.   clip patternpath
  234.   grestore
  235.   newpath
  236. }bdef
  237.  
  238. % <pattern> P -
  239. /P{
  240.  /pattern xdef
  241.  /mypatternfont findfont begin
  242.  FontDict begin
  243.  true
  244.   0 1 patterncount 1 sub {
  245.    dup patterns exch get pattern eq
  246.       {0 1 str length 1 sub{str exch 2 index put}for pop pop false exit}
  247.    if
  248.    pop
  249.  }for
  250.  {
  251.    patterns patterncount pattern put
  252.     0 1 str length 1 sub {str exch patterncount put}for
  253.    /patterncount patterncount 1 add def
  254.  }if
  255.  end
  256.  end
  257.  /FILL{patternfill}bdef
  258.  /EOFILL{patterneofill}bdef
  259.  /STROKE{patternstroke}bdef
  260. }bdef
  261.  
  262. /S{
  263.  /FILL{fill}bdef
  264.  /EOFILL{eofill}bdef
  265.  /STROKE{stroke}bdef
  266. }bdef
  267.  
  268. %
  269. % gradient/radial/shape fill operators
  270. %
  271. /DOGRAD{
  272.  gsave
  273.  pmatrix setmatrix flattenpath exec 
  274.  pathbbox /ury xdef /urx xdef /lly xdef /llx xdef
  275.  angle 0 lt{/angle angle 360 add def}if
  276.  angle 180 gt{/angle angle 180 sub def tc1 tc2 /tc1 xdef /tc2 xdef}if
  277.  angle 90 gt{ /quad {ury exch sub}bdef tc1 tc2 /tc1 xdef /tc2 xdef}{ /quad {lly add}bdef}ifelse
  278.  /l urx llx sub def
  279.  /w ury lly sub def
  280.  /v angle dup 90 gt{90 sub neg 90 add}if dup sin l mul exch cos w mul add 2 mul def
  281.  /d angle dup 90 gt{90 sub neg 90 add}if dup sin w mul exch cos l mul add def
  282.  /steps d 72 div currentscreen pop pop mul cvi 1 add dup 256 gt{pop 256}if def
  283.  /dd d steps div def
  284.  
  285.  0 1 steps
  286.  {
  287.   steps div dup /frac xdef ramp /rfrac xdef
  288.   tc2 0 get tc1 0 get sub rfrac mul tc1 0 get add
  289.   tc2 1 get tc1 1 get sub rfrac mul tc1 1 get add
  290.   tc2 2 get tc1 2 get sub rfrac mul tc1 2 get add
  291.   tc2 3 get tc1 3 get sub rfrac mul tc1 3 get add scmyk
  292.  
  293.   newpath gsave
  294.   l frac mul llx add
  295.   w frac mul quad translate angle rotate 
  296.   dd 2 div neg v 2 div neg moveto
  297.   0 v rlineto dd 0 rlineto 0 v neg rlineto closepath
  298.   FILL grestore
  299.  }for
  300.  
  301.  grestore
  302.  newpath
  303. }bdef
  304.  
  305. %
  306. %
  307. /DORADIAL{
  308.  gsave
  309.  pmatrix setmatrix flattenpath exec 
  310.  pathbbox /ury xdef /urx xdef /lly xdef /llx xdef
  311.  /xc llx urx add 2 div dx add def
  312.  /yc lly ury add 2 div dy add def
  313.  /radius llx xc sub abs dup mul sqrt lly yc sub abs dup mul sqrt add def
  314.  
  315.  /steps radius 72 div currentscreen pop pop mul cvi 1 add dup 256 gt{pop 256}if def
  316.  
  317.  steps -1 0
  318.  {
  319.   steps div dup /frac xdef ramp /rfrac xdef
  320.   tc2 0 get tc1 0 get sub rfrac mul tc1 0 get add
  321.   tc2 1 get tc1 1 get sub rfrac mul tc1 1 get add
  322.   tc2 2 get tc1 2 get sub rfrac mul tc1 2 get add
  323.   tc2 3 get tc1 3 get sub rfrac mul tc1 3 get add scmyk
  324.   newpath xc yc radius frac mul 0 360 arc FILL
  325.  }for
  326.  
  327.  grestore
  328.  newpath
  329. }bdef
  330.  
  331. %
  332. %
  333. /DOSHAPE{
  334.  /steps 30 def
  335.  /fillproc xdef
  336.  
  337.  currentflat mark currentflat
  338.  {
  339.   {
  340.    dup setflat mark fillproc
  341.  
  342.    tc1 0 get tc1 1 get tc1 2 get tc1 3 get scmyk
  343.    currentflat mark currentflat
  344.    {
  345.     dup setflat mark
  346.     {FILL}gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  347.    }loop
  348.    cleartomark setflat
  349.  
  350.    steps -1 0
  351.    {
  352.     steps div dup /frac xdef ramp /rfrac xdef
  353.     tc1 0 get tc2 0 get sub rfrac mul tc2 0 get add
  354.     tc1 1 get tc2 1 get sub rfrac mul tc2 1 get add
  355.     tc1 2 get tc2 2 get sub rfrac mul tc2 2 get add
  356.     tc1 3 get tc2 3 get sub rfrac mul tc2 3 get add scmyk
  357.     []0 setdash xc 2 mul frac mul setlinewidth
  358.  
  359.     currentflat mark currentflat
  360.     {
  361.      dup setflat mark
  362.      {STROKE}gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  363.     }loop
  364.     cleartomark setflat
  365.  
  366.    }for
  367.   }
  368. %  gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {cleartomark setflat stop}if}{cleartomark exit}ifelse
  369.   gsave stopped grestore {cleartomark 1.3 mul dup 100 gt {exit}if}{cleartomark exit}ifelse
  370.  }loop
  371.  cleartomark setflat
  372.  newpath
  373. }bdef
  374.  
  375. %
  376. % join miterlimit cap [dashpattern] dashoffset width lnsfunc lnefunc ST -
  377. %
  378. /ST{
  379.  load /lnefunc xdef load /lnsfunc xdef 
  380.  setlinewidth setdash setlinecap 2 div sin 1 exch div setmiterlimit setlinejoin
  381.  
  382.  /lnsfunc load /LENone load ne {
  383.   mark
  384.   /havestart 0 def
  385.   {havestart 2 eq {x2 x1 sub y1 y2 sub atan 90 add x1 y1 5 -2 roll}if /havestart 1 def /y1 xdef /x1 xdef} %moveto
  386.   {havestart 1 eq {/y2 xdef /x2 xdef x1 x2 ne y1 y2 ne or {/havestart 2 def}if}{pop pop}ifelse} %lineto
  387.   {pop pop pop pop havestart 1 eq {/y2 xdef /x2 xdef x1 x2 ne y1 y2 ne or {/havestart 2 def}if}{pop pop}ifelse} %curveto
  388.   {/havestart 0 def} %closepath
  389.   pathforall
  390.   havestart 2 eq {x2 x1 sub y1 y2 sub atan 90 add x1 y1} if
  391.  }if
  392.  
  393.  /lnefunc load /LENone load ne {
  394.   mark
  395.   /havestart 0 def
  396.   {havestart 2 eq {x2 x1 sub y1 y2 sub atan 90 add x1 y1 5 -2 roll}if /havestart 1 def /y1 xdef /x1 xdef} %moveto
  397.   {/y3 xdef /x3 xdef x1 x3 ne y1 y3 ne or {/x2 x1 def /y2 y1 def /x1 x3 def /y1 y3 def /havestart 2 def}if} %lineto
  398.   {/y4 xdef /x4 xdef /y3 xdef /x3 xdef pop pop
  399.     x1 x3 ne y1 y3 ne or {/x2 x1 def /y2 y1 def /x1 x3 def /y1 y3 def /havestart 2 def}if
  400.     x1 x4 ne y1 y4 ne or {/x2 x1 def /y2 y1 def /x1 x4 def /y1 y4 def /havestart 2 def}if} %curveto
  401.   {/havestart 0 def} %closepath
  402.   pathforall
  403.   havestart 2 eq {x2 x1 sub y1 y2 sub atan 90 add x1 y1} if
  404.  }if
  405.  
  406.  strokepath
  407.  
  408.  /lnefunc load /LENone load ne {
  409.   counttomark 3 div cvi {matrix currentmatrix 4 1 roll translate rotate currentlinewidth dup scale lnefunc setmatrix} repeat pop
  410.  }if
  411.  /lnsfunc load /LENone load ne {
  412.   counttomark 3 div cvi {matrix currentmatrix 4 1 roll translate rotate currentlinewidth dup scale lnsfunc setmatrix} repeat pop
  413.  }if
  414.  
  415. }bdef
  416.  
  417. % fill functions
  418.  
  419. %
  420. % screen spot functions
  421. %
  422. /SSNewDot {180 mul cos exch 180 mul cos add 2 div}bdef
  423. /SSDot {dup mul exch dup mul add 1.0 exch sub}bdef
  424. /SSRing {dup mul exch dup mul add 1.0 exch sub abs 1.0 exch sub}bdef
  425. /SSDonut {dup mul exch dup mul add sqrt .5 sub abs 1.0 exch sub}bdef
  426. /SSLine {exch pop abs}bdef
  427. /SSTriangle {2 exch sub exch abs 2 mul sub 3 div}bdef
  428. /SSPropeller {/y xdef /x xdef y x .001 add atan cvi 72 mod 72 sub abs 72 div y y mul x x mul add 1 exch sub add 2 div}bdef
  429.  
  430. %
  431. % fountain blend functions
  432. %
  433. /FBLinear {}bdef
  434. /FBInvLinear {1 exch sub}bdef
  435. /FBLog {9 mul 1 add log}bdef
  436. /FBInvLog {9 mul 1 add log 1 exch sub}bdef
  437. /FBSin {180 mul sin}bdef
  438. /FBInvSin {180 mul sin 1 exch sub}bdef
  439. /FBSaw {2 mul dup 1 gt {2 exch sub}if}bdef
  440. /FBInvSaw {2 mul dup 1 gt {2 exch sub}if 1 exch sub}bdef
  441.  
  442. %
  443. % line end functions
  444. %
  445. /LENone {}bdef
  446. /LERound {0 0 moveto 0 0 .5 -90 90 arc closepath}bdef
  447. /LEArrow {0 0 moveto 0 2 lineto 6 0 lineto 0 -2 lineto closepath}bdef
  448. /LEArrow1 {0 0 moveto 0 2 lineto 6 0 lineto 0 -2 lineto closepath}bdef
  449. /LEArrow2 {0 0 moveto -2 2 lineto 6 0 lineto -2 -2 lineto closepath}bdef
  450. /LEArrow3 {6 0 moveto -3 0 2.31 300 60 arc closepath}bdef
  451. /LEArrow4 {-1 0 moveto -4 2 .5 240 60 arcn 0 0 .5 60 300 arcn -4 -2 .5 300 120 arcn closepath}bdef
  452. /LESpike1 {0 .5 moveto .5 2 lineto 1 .5 lineto 6 0 lineto 1 -.5 lineto .5 -2 lineto 0 -.5 lineto closepath}bdef
  453. /LESpike2 {0 .5 moveto 2 2 lineto 6 0 lineto 2 -2 lineto 0 -.5 lineto closepath}bdef
  454. /LEFeather1 {-2 0 moveto 0 2 lineto 6 2 lineto 4 0 lineto 6 -2 lineto 0 -2 lineto closepath}bdef
  455. /LEFeather2 {0 -2 moveto 0 0 2 270 90 arcn 6 0 2 90 270 arc closepath}bdef
  456. /LEBox {-2 0 moveto -2 2 lineto 2 2 lineto 2 -2 lineto -2 -2 lineto closepath}bdef
  457. /LEDiamond {-2 0 moveto 0 2 lineto 2 0 lineto 0 -2 lineto closepath}bdef
  458. /LEBall {0 0 moveto 0 0 2 360 0 arcn closepath}bdef
  459. /LEEllipse {2 1 scale 0 0 moveto 0 0 2 360 0 arcn closepath}bdef
  460.  
  461. %
  462. % freq angle spot SS -
  463. %
  464. /SS {
  465.  load setscreen
  466. }bdef
  467.  
  468. %
  469. % text prototypes
  470. %
  471. % (string) F1 -
  472. % (string) kernamt F2 -
  473. % (string) skernamt F3 -
  474. % (string) skernamt kernamt F4 -
  475. %
  476.  
  477. /FS{dup length 1 sub 0 exch 1 exch}bdef
  478. /Fx{1 index exch 1 getinterval dup currentpoint currentpoint newpath moveto 3 -1 roll false charpath FP moveto}bdef
  479. /Sx{1 index exch 1 getinterval dup currentpoint currentpoint newpath moveto 3 -1 roll false charpath SP moveto}bdef
  480.  
  481. /S1{FS {Sx stringwidth rmoveto}for pop}bdef
  482. /S2{/dx xdef FS {Sx stringwidth rmoveto dx 0 rmoveto}for pop}bdef
  483. /S3{/dy xdef FS {Sx dup stringwidth rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  484. /S4{/dy xdef /dx xdef FS {Sx dup stringwidth rmoveto dx 0 rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  485.  
  486. /CFx{
  487.  /F1{FS {Fx stringwidth rmoveto}for pop}bdef
  488.  /F2{/dx xdef FS {Fx stringwidth rmoveto dx 0 rmoveto}for pop}bdef
  489.  /F3{/dy xdef FS {Fx dup stringwidth rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  490.  /F4{/dy xdef /dx xdef FS {Fx dup stringwidth rmoveto dx 0 rmoveto ( ) eq {dy 0 rmoveto}if}for pop}bdef
  491. }bdef
  492.  
  493. %
  494. % c m y k CMYK -
  495. %
  496. /CMYK {
  497.  scmyk
  498.  
  499.  /FP{FILL}bdef
  500.  /EP{EOFILL}bdef
  501.  /SP{STROKE}bdef
  502.  
  503.  /F1{show}bdef
  504.  /F2{exch 0 exch ashow}bdef
  505.  /F3{exch 0 exch 32 exch widthshow}bdef
  506.  /F4{0 exch 32 exch 0 6 -1 roll awidthshow}bdef
  507. }bdef
  508.  
  509. %
  510. % angle /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKGRAD -
  511. %
  512. /CMYKGRAD{
  513.  /tc2 xdef
  514.  /tc1 xdef
  515.  /ramp exch ldef
  516.  /angle xdef
  517.  
  518.  /FP{{clip} DOGRAD}bdef
  519.  /EP{{eoclip} DOGRAD}bdef
  520.  /SP{strokepath {clip} DOGRAD}bdef
  521.  
  522.  CFx
  523. }bdef
  524.  
  525. %
  526. % dx dy /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKRADIAL -
  527. %
  528. /CMYKRADIAL{
  529.  /tc2 xdef
  530.  /tc1 xdef
  531.  /ramp exch ldef
  532.  /dy xdef
  533.  /dx xdef
  534.  
  535.  /FP{{clip} DORADIAL}bdef
  536.  /EP{{eoclip} DORADIAL}bdef
  537.  /SP{strokepath {clip} DORADIAL}bdef
  538.  
  539.  CFx
  540. }bdef
  541.  
  542. %
  543. % inset /ramp [c1 m1 y1 k1][c2 m2 y2 k2] CMYKSHAPE -
  544. %
  545. /CMYKSHAPE{
  546.  /tc2 xdef
  547.  /tc1 xdef
  548.  /ramp exch ldef
  549.  /xc xdef
  550.  
  551.  /FP{{clip} DOSHAPE}bdef
  552.  /EP{{eoclip} DOSHAPE}bdef
  553.  /SP{strokepath {clip} DOSHAPE}bdef
  554.  
  555.  CFx
  556. }bdef
  557.  
  558.  
  559. /installcolor {
  560.  dup type /stringtype eq {pop dangle}if exch dup type /stringtype eq {pop dfreq}if exch /dspot load setscreen
  561.  
  562.  /sepmode xdef
  563.  
  564.  sepmode 1 eq {
  565.   /scmyk{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdef
  566.   /setgray /SG load def
  567.  }if
  568.  
  569.  sepmode 2 eq {
  570.   /scmyk /SCMYK load def
  571.   /setgray /SG load def
  572.  }if
  573.  
  574.  sepmode 3 eq {
  575.   /sepcolor xdef
  576.   sepcolor 0 get 0 ne {/scmyk {pop pop pop 1 exch sub SG}bdef /setgray {pop 1 SG}bdef}if
  577.   sepcolor 1 get 0 ne {/scmyk {pop pop 1 exch sub SG pop}bdef /setgray {pop 1 SG}bdef}if
  578.   sepcolor 2 get 0 ne {/scmyk {pop 1 exch sub SG pop pop}bdef /setgray {pop 1 SG}bdef}if
  579.   sepcolor 3 get 0 ne {/scmyk {1 exch sub SG pop pop pop}bdef /setgray /SG load def}if
  580.  }if
  581.  
  582.  sepmode 4 eq {
  583.   /sepcolor xdef
  584.   /scmyk {
  585.    sepcolor 3 get eq exch
  586.    sepcolor 2 get eq and exch
  587.    sepcolor 1 get eq and exch
  588.    sepcolor 0 get eq and {0 SG}{1 SG}ifelse}bdef
  589.   sepcolor 3 get 1 eq sepcolor 2 get 0 eq and sepcolor 1 get 0 eq and sepcolor 0 get 0 eq and {/setgray /SG load def}{/setgray {pop 1 SG}bdef}ifelse
  590.  }if
  591.  /setcmykcolor /scmyk load def
  592.  
  593.  currentscreen /cspot xdef /cangle xdef /cfreq xdef
  594. }bdef
  595.  
  596. %
  597. % #copies BEGINDOCUMENT -
  598. %
  599. /BeginDocument{
  600.  /#copies xdef
  601.  
  602.   7 dict begin
  603.     /FontDict 12 dict def
  604.     FontDict begin
  605.       /key /mypatternfont def
  606.       /patterns 256 array def
  607.       /patterncount 0 def
  608.       /char 0 def
  609.       /mtx [300 72 div 0 0 300 72 div 0 0] matrix invertmatrix def
  610.       /height 30 def
  611.       /width 30 def
  612.       /ctm matrix currentmatrix def
  613.       /ptm matrix identmatrix def
  614.       /str 32 string def
  615.     end
  616.     /FontBBox [0 0 FontDict /width get FontDict /height get] def
  617.     /FontMatrix FontDict /mtx get def
  618.     /Encoding 256 array 0 1 255 {1 index exch dup 3 string cvs cvn put}for def
  619.     /FontType 3 def
  620.     /BuildChar { %def
  621.       exch begin
  622.       FontDict begin
  623.       /char xdef
  624.        width 0 0 0 width height setcachedevice
  625.       width height scale 8 8 true [8 0 0 -8 0 8] {patterns char get}imagemask
  626.       end end
  627.     }def
  628.     FontDict /key get currentdict definefont pop
  629.   end
  630.  
  631.  /dmatrix dmatrix currentmatrix def
  632.  currentscreen /dspot xdef /dangle xdef /dfreq xdef
  633. }bdef
  634.  
  635. %
  636. % /newfontname /fontname RE -
  637. %
  638. /RE{
  639.  mark {FontDirectory 3 index get} stopped
  640.  {cleartomark
  641.   findfont dup length 2 add dict begin {1 index /FID ne {def}{pop pop}ifelse}forall
  642.   /Encoding PGSEncoding def
  643.   /FontName 1 index def
  644.   currentdict definefont pop
  645.   end
  646.  }
  647.  {cleartomark pop pop}ifelse
  648. }bdef
  649.  
  650. %
  651. % /fontname xscale yscale slant twist F -
  652. %
  653. /F{
  654.  /twist xdef /slant xdef /yscale xdef /xscale xdef
  655.  findfont [xscale 0 0 yscale 0 0] [twist cos twist sin slant sin neg slant cos 0 0] sclm concatmatrix makefont setfont
  656. }bdef
  657.  
  658. %
  659. % - ENDOCUMENT -
  660. %
  661. /EndDocument{
  662. }bdef
  663.  
  664. %
  665. % [sepcolor] sepmode freq/(DEFAULT) angle/(DEFAULT) tilew tileh landscape scaleh scalex paperw paperh BEGINTILE -
  666. %
  667. /BeginTile{
  668.  2 div exch 2 div exch translate
  669.  /tilescaley xdef /tilescalex xdef tilescalex tilescaley scale
  670.  {90 rotate} if
  671.  -2 div exch -2 div exch translate
  672.  
  673.  installcolor
  674.  
  675.  /tmatrix tmatrix currentmatrix def
  676. }bdef
  677.  
  678. %
  679. % - ENDTILE -
  680. %
  681. /EndTile{
  682.  dmatrix setmatrix
  683. }bdef
  684.  
  685. %
  686. % [sepcolor] sepmode freq/(DEFAULT) angle/(DEFAULT) title left top right bottom THUMBNAILMARKS -
  687. %
  688. /ThumbnailMarks{
  689.  /tiley2 xdef
  690.  /tilex2 xdef
  691.  /tiley1 xdef
  692.  /tilex1 xdef
  693.  /title1 xdef
  694.  
  695.  tmatrix setmatrix
  696.  .5 SG 6 setlinewidth
  697.  newpath
  698.  tilex1 3 add tiley2 3 sub moveto
  699.  tilex2 3 add tiley2 3 sub lineto
  700.  tilex2 3 add tiley1 3 sub lineto stroke
  701.  
  702.  0 SG [] 0 setdash .3 setlinewidth 0 setlinejoin 0 setlinecap
  703.  newpath tilex1 tiley1 moveto tilex2 tiley1 lineto tilex2 tiley2 lineto tilex1 tiley2 lineto closepath stroke
  704.  
  705.  gsave tilex1 tilex2 add 2 div tiley2 translate 1 tilescalex div 1 tilescaley div scale -2 -6 bv sub translate
  706.  /PGSCourier/Courier RE /PGSCourier findfont 6 scalefont setfont
  707.  0 0 moveto title1 show
  708.  grestore
  709.  
  710.  installcolor
  711. }bdef
  712.  
  713. %
  714. % left top "BeginPage"
  715. %
  716. /BeginPage{
  717.  tmatrix setmatrix translate 
  718.  /pmatrix pmatrix currentmatrix def
  719. }bdef
  720.  
  721. %
  722. % "EndPage"
  723. %
  724. /EndPage{
  725.  tmatrix setmatrix
  726. }bdef
  727.  
  728. /PPDSetup{countdictstack mark}bdef
  729. /PPDCleanup{stopped cleartomark countdictstack exch sub dup 0 gt{{end}repeat}{pop}ifelse}bdef
  730.  
  731. %
  732. % - "BO" matrix
  733. %
  734. /BO{
  735.  matrix currentmatrix
  736. }bdef
  737.  
  738. %
  739. % aboutx abouty slant twist "r" -
  740. %
  741. /r{
  742.  /twist xdef
  743.  /slant xdef
  744.  
  745.  sclm 0 twist cos put sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat
  746. }bdef
  747.  
  748. %
  749. % aboutx abouty slant twist "R" -
  750. %
  751. /r'{
  752.  /twist xdef
  753.  /slant xdef
  754.  /deltay xdef
  755.  /deltax xdef
  756.  
  757.  deltax deltay translate
  758.  sclm 0 twist cos put sclm 1 twist sin put sclm 2 slant sin neg put sclm 3 slant cos put sclm concat
  759.  deltax neg deltay neg translate
  760. }bdef
  761.  
  762. %
  763. % hscale vscale "s" -
  764. %
  765. /s{scale}bdef
  766.  
  767. %
  768. % xoffset1 yoffset1 hscale vscale xoffset2 yoffset2 "S" -
  769. %
  770. /s'{translate scale neg exch neg exch translate}bdef
  771.  
  772. %
  773. % xoffset yoffset "t" -
  774. %
  775. /t{translate}bdef
  776.  
  777. %
  778. % matrix "EO" -
  779. %
  780. /EO {setmatrix}bdef
  781.  
  782. %
  783. % - BEGINCLIP -
  784. %
  785. /BeginClip {gsave clip}bdef
  786.  
  787. %
  788. % - ENDCLIP -
  789. %
  790. /EndClip {grestore}bdef
  791.  
  792. %
  793. % xscale yscale xoffset yoffset pixelw pixelh bitsperpixel BEGINBITMAP -
  794. %
  795. /BeginBitmap {
  796.  save 8 1 roll /bpp xdef /h xdef /w xdef
  797.  scl translate scale /picstr 8 bpp idiv dup w add 1 sub exch idiv string def
  798.  w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind image
  799. }bdef
  800.  
  801. %
  802. % xscale yscale xoffset yoffset pixelw pixelh bitsperpixel BEGINRGBBITMAP -
  803. %
  804. /BeginRGBBitmap {
  805.  save 8 1 roll /bpp xdef /h xdef /w xdef
  806.  scl translate scale /picstr 8 bpp idiv dup w 3 mul add 1 sub exch idiv string def
  807.  w h bpp [w 0 0 h neg 0 h] {currentfile picstr readhexstring pop}bind false 3 colorimage
  808. }bdef
  809.  
  810. %
  811. % - ENDBITMAP -
  812. %
  813. /EndBitmap {restore}bdef
  814.  
  815. %
  816. % xscalex yscale xoffset yoffset BEGINEPS -
  817. %
  818. /BeginEPS {
  819.  scl translate scale translate
  820.  /PGSEPSSave save def
  821.  /dict_count countdictstack def /op_count count 1 sub def
  822.  userdict begin
  823.  /showpage {}bdef
  824.  newpath 0 setgray 1 setlinewidth [] 0 setdash 0 setlinecap 0 setlinejoin 10 setmiterlimit
  825.  /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint}if }if
  826. }bdef
  827.  
  828. %
  829. % - ENDEPS -
  830. %
  831. /EndEPS {count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat PGSEPSSave restore}bdef
  832.  
  833. %
  834. % angle cx cy cropmark -
  835. %
  836. /cropmark {
  837.   gsave translate 1 tilescalex div 1 tilescaley div scale rotate
  838.   .3 setlinewidth newpath
  839.   bh 5 add 0 moveto 20 0 rlineto
  840.   0 bv 5 add moveto 0 20 rlineto
  841.   stroke grestore
  842. }bdef
  843.  
  844. %
  845. % dx dy cx cy regmark -
  846. %
  847. /regmark {
  848.   gsave translate 1 tilescalex div 1 tilescaley div scale translate
  849.   .3 setlinewidth newpath
  850.   10 0 moveto 0 0 10 0 360 arc
  851.   1 SG fill
  852.   8 0 moveto 0 0 8 0 360 arc
  853.   -10 0 moveto 10 0 lineto 0 -10 moveto 0 10 lineto
  854.   0 SG stroke
  855.   4 0 moveto 0 0 4 0 360 arc
  856.   fill
  857.   -4 0 moveto 4 0 lineto 0 -4 moveto 0 4 lineto
  858.   1 SG stroke
  859.   grestore
  860. }bdef
  861.  
  862. %
  863. % dx dy cx cy slurgauge -
  864. %
  865. /slurgauge {
  866.   gsave translate 1 tilescalex div 1 tilescaley div scale translate
  867.   .3 setlinewidth newpath
  868.   0 0 10 0 360 arc
  869.   1 SG fill
  870.   0 0 10 0 360 arc
  871.   0 SG stroke
  872.   36 { 1 0 moveto 0 0 10 -2.5 2.5 arc fill 10 rotate}repeat
  873.   grestore
  874. }bdef
  875.  
  876. /boxit {newpath moveto 14 0 rlineto 0 -14 rlineto -14 0 rlineto closepath}def
  877.  
  878. %
  879. % angle dx dy cx cy colorstrip -
  880. %
  881. /colorstrip {
  882.   gsave translate 1 tilescalex div 1 tilescaley div scale translate rotate
  883.  
  884.   /PGSCourier/Courier RE /PGSCourier findfont 6 scalefont setfont
  885.  
  886.   sepmode 1 eq {
  887.     0 8 translate
  888.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill}for
  889.    }if
  890.  
  891.   sepmode 2 eq sepmode 3 eq or {
  892.     gsave 320 15 translate
  893.     0 0 boxit .5 .41 .41 0 scmyk fill
  894.     15 0 boxit 0 0 0 .5 scmyk fill
  895.     30 0 boxit 1 1 0 0 scmyk fill
  896.     45 0 boxit 1 0 1 0 scmyk fill
  897.     60 0 boxit 0 1 1 0 scmyk fill
  898.     75 0 boxit 1 1 1 0 scmyk fill
  899.     1 SG
  900.     33 -6 moveto (CM) show
  901.     48 -6 moveto (CY) show
  902.     63 -6 moveto (MY) show
  903.     77 -6 moveto (CMY) show
  904.     grestore
  905.  
  906.  
  907.     0 0 0 1 scmyk -6 9 moveto (K) show
  908.     0 1 9 {dup 15 mul 15 boxit 10 div 0 0 0 4 -1 roll scmyk fill}for
  909.  
  910.     1 0 0 0 scmyk -6 -6 moveto (C) show
  911.     0 1 9 {dup 15 mul 0 boxit 10 div 0 0 0 scmyk fill}for
  912.  
  913.     0 1 0 0 scmyk 154 9 moveto (M) show
  914.     0 1 9 {dup 15 mul 160 add 15 boxit 10 div 0 exch 0 0 scmyk fill}for
  915.  
  916.     0 0 1 0 scmyk 154 -6 moveto (Y) show
  917.     0 1 9 {dup 15 mul 160 add 0 boxit 10 div 0 0 3 -1 roll 0 scmyk fill}for
  918.  
  919.    }if
  920.  
  921.   sepmode 4 eq {
  922.     320 0 translate
  923.     0 1 9 {dup 15 mul 0 boxit 10 div SG fill}for
  924.    }if
  925.  
  926.   grestore
  927. }def
  928.  
  929. %
  930. % title1 title2 tilew tileh PRINTERSMARKS -
  931. %
  932. /PrintersMarks {
  933.  /tileh xdef
  934.  /tilew xdef
  935.  /title2 xdef
  936.  /title1 xdef
  937.  
  938.  gsave 0 SG [] 0 setdash 0 setlinejoin 0 setlinecap
  939.  
  940.  180 0 0 cropmark
  941.  270 tilew 0 cropmark
  942.  0 tilew tileh cropmark
  943.  90 0 tileh cropmark
  944.  
  945.  0 15 bv add tilew 2 div tileh regmark
  946.  0 -15 bv sub tilew 2 div 0 regmark
  947.  
  948.  -15 bh sub -15 bv sub 0 0 slurgauge
  949.  15 bh add 15 bv add tilew tileh slurgauge
  950.  
  951.   gsave 1 tilescalex div 1 tilescaley div scale -15 bh sub 8 translate 90 rotate
  952.   /PGSCourier/Courier RE /PGSCourier findfont 8 scalefont setfont
  953.   0 0 moveto title1 show
  954.   0 -8 moveto title2 show (  ) show
  955.   currentscreen pop exch 20 string cvs show ( lpi  ) show
  956.   20 string cvs show (\260  ) show
  957.   tilescalex 100 mul 20 string cvs show (%) show
  958.   tilescaley tilescalex ne {(,) show tilescaley 100 mul 20 string cvs show (%) show}if
  959.   grestore
  960.  
  961.  90 bh 15 add 15 tilew 0 colorstrip
  962.  grestore
  963. }bdef
  964.  
  965. end
  966. %%EndProlog
  967.